package handler

const (
	_HashKey  = 100 + iota
	_GetQr
	_PayCheck
)

const (
	_ForbidOperation   = "禁止操作"
	_ApiError          = "请求接口错误"
	_Success           = "success"
	_Failed            = "failed"
	_Pending           = "pending"
	_TRADE_ORDER_STATE = "TRADE_ORDER_STATE"
	_TRADE_SUCCESS      = "TRADE_SUCCESS"
)

type NotifyForm struct {
	Mode      int    `json:"mode"`
	ID        string `json:"id"`
	ClientId  string `json:"client_id"`
	Type      string `json:"type"`
	Status    string `json:"status"`
	Msg       string `json:"msg"`
	KdtId     int    `json:"kdt_id"`
	Sign      string `json:"sign"`
	Version   int    `json:"version"`
	Test      bool   `json:"test"`
	SendCount int    `json:"send_count"`
}

type NotifyMsg struct {
	PayType string `json:"pay_type"`
	Tid     string `json:"tid"`
	Payment string `json:"payment"`
	BookId  string `json:"book_id"`
}

type Response struct {
	Msg      interface{}
	StatusOk bool
	Code     uint
}

func ErrorResp(code uint, msg interface{}) Response {
	return Response{Code: code, Msg: msg, StatusOk: false}
}

func SuccessResp(code uint, msg interface{}) Response {
	return Response{Code: code, Msg: msg, StatusOk: true}
}
